package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by young on 2017/6/23.
 */
public class JDBCutil {
    private static Connection connection;

    public static Connection getConnection() {
        String username = "root";
        String password = "1234";
        String driver = "com.mysql.jdbc.Driver";
        String url = "jdbc:mysql://localhost:3306/deliver?useSSL=false";
        try {
            Class.forName(driver);
            connection = DriverManager.getConnection(url, username, password);
        } catch (SQLException | ClassNotFoundException e) {
            e.printStackTrace();

        }
        return connection;
    }
}
